(function(){BX.namespace("BX.SocialServices.Auth");BX.SocialServices.Auth={init:function(e){this.signedParameters=e.signedParameters;this.componentName=e.componentName;var o=document.querySelector("[data-role='socserv-logout']");if(BX.type.isDomNode(o)){BX.bind(o,"click",function(){this.showConfirmLogoutPopup(this.logout.bind(this))}.bind(this))}},logout:function(){var e=document.getElementsByClassName("network-note");var o=this.showLoader({node:e[0],loader:null,size:100});BX.ajax.runComponentAction(this.componentName,"logout",{signedParameters:this.signedParameters,mode:"ajax",data:{}}).then(function(e){this.hideLoader({loader:o});this.showSuccessPopup()}.bind(this),function(e){this.hideLoader({loader:o})}.bind(this))},showSuccessPopup:function(){BX.PopupWindowManager.create({id:"socserv-logout-success-popup",content:BX.create("div",{props:{style:"max-width: 450px"},html:BX.message("SOCSERV_LOGOUT_SUCCESS")}),closeIcon:true,lightShadow:true,offsetLeft:100,overlay:false,contentPadding:10}).show()},showConfirmLogoutPopup:function(e){BX.PopupWindowManager.create({id:"socserv-logout-confirm-popup",titleBar:BX.message("SOCSERV_LOGOUT_TITLE"),content:BX.create("div",{props:{style:"max-width: 450px"},html:BX.message("SOCSERV_LOGOUT_TEXT")}),closeIcon:false,lightShadow:true,contentColor:"white",offsetLeft:100,overlay:false,contentPadding:10,buttons:[new BX.UI.CreateButton({text:BX.message("SOCSERV_BUTTON_CONTINUE"),className:"ui-btn ui-btn-danger",events:{click:function(){this.context.close();e()}}}),new BX.UI.CancelButton({text:BX.message("SOCSERV_BUTTON_CANCEL"),events:{click:function(){this.context.close()}}})],events:{onPopupClose:function(){this.destroy()}}}).show()},showLoader:function(e){var o=null;if(e.node){if(e.loader===null){o=new BX.Loader({target:e.node,size:e.hasOwnProperty("size")?e.size:40})}else{o=e.loader}o.show()}return o},hideLoader:function(e){if(e.loader!==null){e.loader.hide()}if(e.node){BX.cleanNode(e.node)}if(e.loader!==null){e.loader=null}}}})();
//# sourceMappingURL=script.map.js